<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="cw" uri="/widget-tags"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<cw:base />
		<script type="text/javascript">
			//属性表格数据
			var propdata={'appName':'WidgetCenter',
					  'version':'0.9',
					  'Dev':true,
					  'Created':new Date(Date.parse('10/25/2009')),
					  'Desc':'A Web Framwork'};
			var modifiedData=new Array();
			//模仿提交数据
			function submitData(id){
		  		alert(modifiedData);	
		  		modifiedData=new Array();
		  	}
		  	//获取变更数据
		  	function propdata_propertychange(source,id,value,oldValue ){
		  		var data="{id:'"+id+"',value:'"+value+"'}";
		  		modifiedData.push(data);
		  	}  	
		</script>
	</head>
	<body style="margin: 5px">
		<ul>
			<li>
				<cw:fieldSet title="属性表格" content="attributeGrid1Div" collapsible="true" collapsed="false"/>
				<div id="attributeGrid1Div">
					<cw:propertyGrid src="propdata" id="attributeGrid" width="350" height="200"
						title="" propertyChange="propdata_propertychange" >
					</cw:propertyGrid>
					<input type="button" value="测试提交" onclick="submitData('attributeGrid');" />
				</div>
			</li>
		</ul>
		<cw:theme></cw:theme>
		<script type="text/javascript">
			Ext.onReady(function(){
				var STORE1 = Ext.getCmp('attributeGrid').store;
				STORE1.on("load",function(s,r,o){
					resetHeight("attributeGridFrame");
			    });
				
				resetHeight("attributeGridFrame");
			})
		
			function resetHeight(frame){
				var ifm = parent.document.getElementById(frame);
				var initHeight = parseInt(document.body.scrollHeight);
				ifm.height = parseInt(initHeight);
			}
		</script>
	</body>
</html>